import cv2
import numpy as np
import matplotlib.pyplot as plt

img=cv2.imread('CV-Pictures/005.jpg')
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
cv2.imshow('img',img)
ret1,dst=cv2.threshold(gray,127,255,cv2.THRESH_BINARY)
# ret2,ostu=cv2.threshold(gray,127,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
adapt_thresh=cv2.adaptiveThreshold(gray,255,cv2.ADAPTIVE_THRESH_MEAN_C,
                      cv2.THRESH_BINARY,19,2)
cv2.imshow('dst',dst)
# cv2.imshow('OSTU',ostu)
cv2.imshow('adapt_thresh',adapt_thresh)
cv2.waitKey(0)
cv2.destroyAllWindows()

